{
 "cells": [
  {
   "cell_type": "code",
   "id": "initial_id",
   "metadata": {
    "collapsed": true
   },
   "source": [
    "import gradio as gr\n",
    "from transformers import *\n",
    "from MyHelper import Config"
   ],
   "outputs": [],
   "execution_count": null
  },
  {
   "metadata": {},
   "cell_type": "markdown",
   "source": "样例1：文本分类",
   "id": "7d0ebfeaf237081d"
  },
  {
   "metadata": {},
   "cell_type": "code",
   "source": "gr.Interface.from_pipeline(pipeline(\"text-classification\", model=Config.roberta_base_finetuned_dianping_chinese)).launch()",
   "id": "6c76e910b54db64c",
   "outputs": [],
   "execution_count": null
  },
  {
   "metadata": {},
   "cell_type": "markdown",
   "source": "样例2：阅读理解",
   "id": "2d83ac5ba9746802"
  },
  {
   "metadata": {},
   "cell_type": "code",
   "source": "gr.Interface.from_pipeline(pipeline(\"question-answering\", model=Config.roberta_base_finetuned_dianping_chinese)).launch()",
   "id": "97b7580abf53bb7d",
   "outputs": [],
   "execution_count": null
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
